var ProviderTable = function () {
  var template = /* html */ `
    <div class="provider-table" v-loading.fullscreen.lock="loading">
      <el-container style="height:100%;">
        <el-aside class="companyMaterialUpdate" width="35%">
          <customer-form type="update" :customer-type="1" :customer="updateCustomer" @save-success="updateCustomerAfter"></customer-form>
        </el-aside>
        <el-main class="companyMaterialQuery" width="65%">
          <search-btn-view btn-text="查询" @before-open="resetSearch" @search="searchData">
            <template slot="append">
              <el-button type="primary" size="medium" @click="showCustomerAddForm">新增供应商</el-button>
            </template>
            <div slot="search-content">
              <search-form ref="searchForm" :search="search" :type="1"></search-form>
            </div>
          </search-btn-view>
          <div class="customerDiv">
            <el-table fit stripe border :data="customerList" style="width: 100%" height="parent" @row-click="getCustomerDetail">
              <el-table-column prop="customerCode" label="供应商代码" min-width="120px" header-align="center"></el-table-column>
              <el-table-column prop="customerName" label="供应商名称" min-width="150px" header-align="center"></el-table-column>
              <el-table-column prop="contact" label="联系人" min-width="100px" header-align="center"></el-table-column>
              <el-table-column :resizable="false" label="结算付款方式" min-width="120px" align="center">
                <template slot-scope="scope">
                  {{i18n.getMsg('customer.paymentWayType.'+scope.row.paymentWay)}}
                </template>
              </el-table-column>
              <el-table-column prop="phone" label="联系电话" min-width="130px" header-align="center"></el-table-column>
              <el-table-column prop="email" label="邮箱地址" min-width="220px" header-align="center">
                <template slot-scope="scope">
                  <div v-for="str in scope.row.email" :key="str">{{str}}</div>
                </template>
              </el-table-column>
              <el-table-column :resizable="false" prop="status" label="状态" min-width="80px" align="center"></el-table-column>
            </el-table>
          </div>
          <div style="margin-top:10px;text-align:right;" v-if="pagination.totalCount!==0">
            <el-pagination background :page-size="pagination.pageSize" :total="pagination.totalCount"
              :current-page.sync="pagination.currentPage" @current-change="pageChange">
            </el-pagination>
          </div>
        </el-main>
      </el-container>

      <el-dialog title="添加供应商" :close-on-press-escape="false" :close-on-click-modal="false" :visible.sync="isShowCustomerAddForm"
        top="5vh">
        <div style="height:calc(80vh - 54px);overflow:auto">
          <customer-form v-if="isShowCustomerAddForm" :customer-type="1" @save-success="addCustomerAfter">
          </customer-form>
        </div>
      </el-dialog>
    </div>
  `;

  return {
    mixins: [CustomerMixin(1)],

    data: function () {
      return {
        i18n: i18n
      };
    },

    template: template
  };
}();
